/*
 * @Title: 反向拼团-支付成功提示
 * @Author: zhj
 * @Date:   2018-12-20
 * @Last Modified by:   zhj
 * @Last Modified time: 2018-12-20
 */
var dataInfo = new Object(),
  template = {
    init: function() {
      Vue.use(VueLazyload, {
        preLoad: 1.3,
        error: 'https://h5.meetao.com/img/product/init.png',
        loading: 'https://h5.meetao.com/img/product/init.png',
        attempt: 1
      });
      dataInfo.init = new Vue({
        el: '#app',
        data: {
          DrawTip: true, //是否显示获得一次抽奖机会
          bottowPopup: { //底部弹框
            shareShow: false, //分享弹框
            faceShow: false, //面对面扫码
          },
          href: "", //面对面分享图片地址
          inviterId: !getQueryString("inviterId") || getQueryString('inviterId') == 'null' ? userId : getQueryString("inviterId")
        },
        methods: {
          share_show: function() { //分享弹窗
            dataInfo.init.bottowPopup.shareShow = true;
            dataInfo.init.DrawTip = false;
          },
          onluckDraw: function() { //跳转抽奖页面
            window.location.href = "../html/FPtPrizeInit.html";
          },
          onMyVote: function() { //跳转我的票选页面
            window.location.href = "../html/FPtMyVote.html";
          },
          onVoteGoods: function() {
            window.location.href = "../html/FPtVoteDetails.html?voteItemCode=" + getQueryString("voteItemCode");
          },
          clearPopup: function() {
            dataInfo.init.DrawTip = false;
          },
          popup_face: function() {
            dataInfo.init.bottowPopup.faceShow = false;
          },
          popup_close: function() { //关闭分享弹窗
            dataInfo.init.bottowPopup.shareShow = false;
          },
          popup_face_show: function() {
            dataInfo.init.bottowPopup.shareShow = false;
            dataInfo.init.bottowPopup.faceShow = true;
            dataInfo.init.onFaceImg();
            ajaxTemplate(addressTest + SERVICE.saveShareLog, function(data) {
              if (data.tag == 0) {} else {
                dataInfo.init.$toast(data.errMsg);
              }
            }, {
              userId: userId,
              pageType: "pageVoteActivityPaySuccess",
              shareType: "dangmian"
            });
          },
          onFaceImg: function() { //获取面对面扫码图片地址
            dataInfo.init.http = window.location.href.split("/html/")[0] + "/html/FPtVoteDetails.html?voteItemCode=" + getQueryString("voteItemCode") + "&inviterId=" + this.inviterId + "&shareShopCode=" + shareShopCode + "&shareUserId=" + shareUserId;
            dataInfo.init.href = 'https://svr.meetao.com/api/groupon/common/makeQRCode?content=' + escape(dataInfo.init.http) + '&imgWidth=200&imgHeight=200&imgFormat=png';
          }
        },
      });
    }
  };

template.init();
